/*
 * @Author: humengchuan 531537052@qq.com
 * @Date: 2025-08-12 17:12:10
 * @LastEditors: humengchuan 531537052@qq.com
 * @LastEditTime: 2025-08-12 20:42:15
 * @FilePath: \project\work-tool\my-dev-project\src\store\index.ts
 * @Description: 
 */
import {create } from 'zustand'

const useStore = create<{
    name: string,
    age: number, 
    setName: (name: string) => void, 
    setAge: (age: number)=> void,
    userInfo: {
      desc: string,
      imgSrc: string,
    }
    setUserInfo: (userInfo: {desc: string, imgSrc: string}) => void
}>((set) => ({
  name: 'John Doe',
  age: 20,
  userInfo: {
    desc: '',
    imgSrc: '',
  },
  setName: (name) => set({ name }),
  setAge: (age) => set({ age }),
  setUserInfo: (userInfo) => set({ userInfo }),
}))

export default useStore